import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt

img = cv.imread("assets/lena.jpg")

plt.figure(figsize=(10,10))
plt.subplot(321)
plt.imshow(cv.cvtColor(img, cv.COLOR_BGR2RGB))

kernel_3x3 = np.array([[-1, -1, -1],
                       [-1, 8, -1],
                       [-1, -1, -1]])
kernel_5x5 = np.array([[-1, -1, -1, -1, -1],
                       [-1, 1, 2, 1, -1],
                       [-1, 2, 4, 2, -1],
                       [-1, 1, 2, 1, -1],
                       [-1, -1, -1, -1, -1]])

kernel_5x5 = kernel_5x5

img3 = cv.filter2D(img,-1,kernel_3x3)
plt.subplot(322)
plt.imshow(cv.cvtColor(img3, cv.COLOR_BGR2RGB))

img5 = cv.filter2D(img,-1,kernel_5x5)
plt.subplot(323)
plt.imshow(cv.cvtColor(img5, cv.COLOR_BGR2RGB))

img_canny = cv.Canny(img, 100, 300)
plt.subplot(324)
plt.imshow(cv.cvtColor(img_canny, cv.COLOR_BGR2RGB))

plt.show()